package com.github.ecbp.user.service.service;

import com.github.ecbp.common.data.service.BaseService;
import com.github.ecbp.user.service.entity.TPermission;
import com.github.ecbp.user.service.entity.TRole;
import com.github.ecbp.user.service.entity.TRolePermissionRelation;

import java.util.List;
import java.util.Set;

/**
 * @name: RolePermissionRelationService
 * @description:
 * @author: zhangj
 * @create: 2020-05-08 11:17
 **/
public interface RolePermissionRelationService extends BaseService<TRolePermissionRelation> {
    /**
     * 通过角色ID查询权限信息
     *
     * @param roleId
     * @return java.util.Set<com.ecbp.service.user.entity.TPermission>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TPermission> getPermissionByRoleId(Long roleId);

    /**
     * 通过角色ID查询权限信息
     *
     * @param roleIds
     * @return java.util.Set<com.ecbp.service.user.entity.TPermission>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TPermission> getPermissionByRoleId(Set<Long> roleIds);

    /**
     * 通过权限信息查询角色信息
     *
     * @param permissionId
     * @return java.util.Set<com.ecbp.service.user.entity.TRole>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TRole> getRoleByPermissionId(Long permissionId);

    /**
     * 通过权限信息查询角色信息
     *
     * @param permissionIds
     * @return java.util.Set<com.ecbp.service.user.entity.TRole>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TRole> getRoleByPermissionId(Set<Long> permissionIds);
}
